<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8;" > 
</head>
<body>
    <center>
        <div style="border:2px solid black; width:300px; text-align: center;">
        <?php
            require 'classDB.inc.php';
            require 'plugins/i18n/classI18N.inc.php';
            require 'definitions.inc.php';
            require 'plugins/users/classUsersData.inc.php';

            //class for DB management
            $_DB = new classDB();
            $_DB->open();

            //set language
            $_i18n = new classI18N();
            $language = $_i18n->getActual();
            if($language!=-1 and $language!='') require $language;

            $sql_result = mysql_query('SELECT * FROM users_new_psswds WHERE identificator="'.$_REQUEST['identifier'].'"');
            //echo 'SELECT * FROM users_new_psswds WHERE identificator="'.$_REQUEST['identifier'].'"';
            $sql_obj = mysql_fetch_object($sql_result);

            if($sql_obj->id==''){                
                echo 
                    _i18n_user_YOUR_REQUEST_IS_INVALID_OR_OUT_OF_DATE_.'
                    <br>
                    <br>
                    <a href="http://'.$_SERVER['HTTP_HOST'].'">'._i18n_user_GO_TO_ESHOP_.'</a>
                    <br>
                    <br>
                ';
            }
            else{
                $_UsersData = new classUsersData();
                $_UsersData->Update_Password($sql_obj->user_id, $sql_obj->new_password);
                $_UsersData->ForgottenPasswd_DeleteNewPassword($sql_obj->user_id);
                echo '
                    <br>
                    <b>'._i18n_user_CHANGE_OF_YOUR_PASSWORD_WAS_SUCCESSFULL_CONFIRMED_.'</b>
                    <br>
                    '._i18n_user_NOW_YOU_CAN_LOGIN_WITH_NEW_PASSWORD_.' ('._i18n_user_YOU_CAN_FIND_PASSWORD_IN_EMAIL_.')
                    <br>
                    <br>
                    '._i18n_user_THIS_PASSWORD_YOU_CAN_CHANGE_IN_YOUR_ACCOUT_.'
                    <br>
                    <br>
                    <br>
                    <a href="http://'.$_SERVER['HTTP_HOST'].'">'._i18n_user_GO_TO_ESHOP_.'</a>
                    <br>
                    <br>
                ';
            }
        ?>
        </div>
    </center>
</body>
</html>
